﻿
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>订单记录</title>
	<meta name="viewport" content="initial-scale=1, maximum-scale=1">
	<meta name="format-detection" content="telephone=no" />
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="css/animation.css">
	<link rel="stylesheet" href="css/light7.min.css">
	<link rel="stylesheet" href="css/light7-swipeout.css">
	<link rel="stylesheet" href="css/light7-swiper.min.css">
	<link rel="stylesheet" href="css/wap_style.css">
	<style type="text/css">
	#main {
		position:absolute;
		left:0px;
		right:0px;
		overflow:auto;
	}
	</style>
</head>
<body>
<div class="page" id="trade_orders">
	<header class="bar bar-nav  l-color">
		<a class="external icon pull-left return-icon back" href="{:url('deal_way')}">
			<img src="picture/return_gray.png" width="100%">
		</a>
		<h1 class="header-title">订单记录</h1>
	</header>
	<div class="content infinite-scroll transfer-content ">

		<div class="section" id="main">
			<div class="section" style="background-color: #fff;" id="order">
				
			</div>
				<!-- <div class="list-item" style="background-color: #fff;margin-top: .5rem;padding: 0 ">
					<div class="card-header" style="font-size: .65rem; min-height: 2rem;">
						<span>时间：2018-36-69 12:12:12</span>
							<span class="color-warning">待付款</span>
					</div>
					<div class="card-content">
						<div>买方：庄哥哥 &emsp;卖方：大笨蛋</div>
						<div>数量：100 &emsp;价格：3.25</div>
					</div>
					<div class="card-footer">
						<a class="external click-btn small in-block blue" style="margin-top: 0px;width: 100%"
							   href="{:url('order_info')}" data-id="{{id}}" data-s="TrandConf.InfoView" data-root="trand">查看详情</a>
					</div>
				</div> -->
				<div class="infinite-scroll-preloader" id="jiazai" style="display: none;"><div class="preloader"></div></div>
				<div class="infinite-scroll-preloader" style="display: none" id="bottom"><fieldset style="border: none;border-top: 1px solid #e8e8e8 ;margin: 0 20px; "><legend style="padding: 0 10px">已经到底了</legend></fieldset></div>
		</div>
		
	</div>
</div>
<script type="text/javascript">
	var base_url = 'http://www.jiaoyi.com/',sellid=0,off_on= true;
</script>
<script type='text/javascript' src='js/jquery-3.3.1.min.js' charset='utf-8'></script>
<script type='text/javascript' src='js/light7.min.js' charset='utf-8'></script>
<script type='text/javascript' src='js/light7-swiper.min.js' charset='utf-8'></script>
<script type='text/javascript' src='js/light7-swipeout.js' charset='utf-8'></script>
<script type='text/javascript' src='js/cn.min.js' charset='utf-8'></script>
<script type='text/javascript' src='js/layui.js' charset='utf-8'></script>
<script type='text/javascript' src='js/basis.js' charset='utf-8'></script>
</body>
<script type="text/javascript">
	var base_url = 'http://www.jiaoyi.com/';
$('#main').scroll(function() {
	//当时滚动条离底部60px时开始加载下一页的内容
	if (($(this)[0].scrollTop + $(this).height() + 60) >= $(this)[0].scrollHeight) {
		
		//这里用 [ off_on ] 来控制是否加载 （这样就解决了 当上页的条件满足时，一下子加载多次的问题啦）
		if (off_on) {
			off_on = false;
			getbuy()
			//page++;
			//console.log("第"+page+"页");
			//LoadingDataFn();  //调用执行上面的加载方法
		}
	}
});
		function getbuy(){
			$.ajax({
				type:'post',
				url : "{:url('get_user_order')}",
				data:{num:sellid},
				cache:false,
				dataType:'JSON',
				success:function(data){
					console.log(data)
					sellid++
					if(data.length != 0){
						var html = '';
						$.each(data,function(index, el) {
							var moneytrue = el.types ==1 ? el.money:0;
								html += '<div class="list-item" style="background-color: #fff;margin-top: .5rem;padding: 0 ">'
							         +       '<div class="card-header" style="font-size: .65rem; min-height: 2rem;">'
							         +           '<span>时间：2018-36-69 12:12:12</span>'
							         +               '<span class="'+el.class+'">'+el.code+'</span>'
							         +       '</div>'
							         +       '<div class="card-content">'
							         +           '<div>买方：'+el.buy.nickname+' &emsp;卖方：'+el.sell.nickname+'</div>'
							         +           '<div>数量：'+el.money+' &emsp;价格：'+el.price+'</div>'
							         +       '</div>'
							         +       '<div class="card-footer">'
							         +           '<a class="external click-btn small in-block blue" style="margin-top: 0px;width: 100%" href="{:url('order_info')}?id='+el.id+'" data-id="{{id}}" >查看详情</a>'
							         +       '</div>'
							         +   '</div>';
						});
						if(data.length<6){
							console.log(1);
							$('#jiazai').hide();
							$('#bottom').show();
						}else{
							console.log(data.length)
							$('#jiazai').show();
						}
						off_on = true;
						$('#order').append(html);
					}else{
						webToast('没有啦');
					}
				},
				error:function(e){
					webToast('没有啦');
				},
				beforeSend:function(e){
					
				}
			});

		}
</script>
<script type="text/javascript">
	$(function(){
		getbuy()
	})
</script>
</html>
